package com.longcai.piaojia.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.longcai.piaojia.R;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

/**
 * Created by Administrator on 2015/6/11.
 */
public abstract class HomeShowDialog extends BaseDialog {

    public HomeShowDialog(Context context, int resId) {

        super(context);

        setContentView(R.layout.dialog_home_show);

        ImageView dialog_home_show_iv = (ImageView) findViewById(R.id.dialog_home_show_iv);

        dialog_home_show_iv.setImageResource(resId);

        View.OnClickListener listener = new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                switch (v.getId()) {

                    case R.id.dialog_home_show_iv:

                        confirm();

                        break;

                    case R.id.dialog_home_show_tv:


                        break;
                }

                dismiss();

            }
        };

        findViewById(R.id.dialog_home_show_tv).setOnClickListener(listener);

        dialog_home_show_iv.setOnClickListener(listener);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) findViewById(R.id.dialog_home_show_ll));

        getWindow().setGravity(Gravity.CENTER);

    }

    public abstract void confirm ();

}
